<?php
/**
 * Created by PhpStorm.
 * Admininfo: Administrator
 * Date: 2017/12/11
 * Time: 15:49
 */

namespace app\admin\model;
use think\Config;
use think\Model;
use traits\model\SoftDelete;
class Admininfo extends  Model
{
    use  SoftDelete;
    protected $deleteTime = 'delete_time';
	protected $autoWriteTimestamp = true;
	protected $createTime = 'create_time';
	protected $updateTime = 'updata_time';
	protected $insert=[
		  'status'=>1,
		];
	public  function  gorup(){
		 return $this->belongsTo('Admingroup','user_group_id')->where(['status'=>1]);
	}
    protected function setPassAttr($value)
    {
        $str=Config::get('salt');
        if($value){
            return md5($str.$value);
        }else{
            return false;
        }
    }
}